<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
  .div1 {
    display: flex;

  }
  .div1 :first-child{
    background-color: green;
    flex: 0 0 50px;
  }
  .div1 :nth-child(2){
    background-color: red;
    flex: 1;
  }
  .div1 :nth-child(3){
    background-color: green;
    flex: 0 0 50px;
  }

  </style>
</head>
<body>
  <div class="div1">
  <div>1</div>
  <div>2</div>
  <div>3</div>
</div>
</body>
</html>